package com.IO.OutputStream;

import java.io.File;
import java.io.FileOutputStream;

/**
 * name：zhangwang
 * time：2025/3/11 17:45
 */
public class Test1 {
    public static void main(String[] args) throws Exception {
        File file = new File("a.txt");
        //追加写数据     第一个参数：数据写入路径 。第二个参数：是否追加写数据，true就是追加写数据
        FileOutputStream outputStream = new FileOutputStream(file,true);
        outputStream.write("\r\n".getBytes());
        outputStream.write(99);
        outputStream.write("/r/n".getBytes());//换行，将字符串转换为字符数据
        outputStream.write(99);
        outputStream.write("\r\n".getBytes());
        outputStream.write(99);
        outputStream.write(99);
        outputStream.close();
    }
}
